#include "memdruk.h"

#ifdef __cplusplus
#include <cstring>
#include <cstdio>
#include <cstdlib>
#else
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#endif

#define SIZE 10

int main () {
  char source[] = { 10, 20, 30, 40, 50 };
  char *destination;
  destination = (char*) malloc( (SIZE) * sizeof *destination );

  memcpy(destination, source, 4);
  printf("Kopiuje 4 znaki od indeksu [0] do [3]\n");
  drukHexInd(destination, 4);
  
  memmove(destination+2, destination, 4);
  printf("Kopiuje 4 znaki od indeksu [2] do [5]\n");
  drukHexInd(destination, 6);
  
  free(destination);
  return 0;
}